<template>
	<view>
		<image ref="waveravatar" :style="{opacity:opacity}" style="width: 20px;height: 20px;border-radius: 20px;" :src="src"></image>
	</view>
</template>

<script>
// #ifdef APP-PLUS
const animation = weex.requireModule('animation');
// #endif

export default {
	name: 'em-empty',
	components: {},
	props: {
		src: {
		  type: String,
		  default:""
		},
	},
	data() {
		return {
			opacity:1,
		};
	},
	watch:{},
	computed: {
	},
	async created() {
		await this.$nextTick()
		let _this = this
		setInterval(()=>{
			_this.opacity = _this.opacity==1?0:1
		},300)
		//this.waverAvatar()
	},
	methods: {
		waverAvatar(){
			this.opacity = this.opacity==1?0:1
			animation.transition(this.$refs['waveravatar'],{
			   styles:{
				   opacity:this.opacity
			   },
			   duration: 500, //ms
			   needLayout:false,
			   timingFunction: 'linear',
			   delay: 0 //ms                  
			},res=>{
				this.waverAvatar()
				//console.log(_this.$refs[messageid][0])
			})
		}
	}
};
</script>

<style scoped>
.loading-wrapper {
	position: absolute;
	left: 0;
	right: 0;
	z-index: -1;
	background-color: #ffffff;
	/* #ifdef APP-NVUE */
	flex: 1;
	/* #endif */
	/* #ifndef APP-NVUE */
	display: flex;
	/* #endif */
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.loading-wrapper-embed {
	flex: 1;
	position: absolute;
	margin-top: 0;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 0;
	text-align: center;
	background-color: transparent;
	z-index: 1;
}
</style>
